/* 
 * Copyright (C), 2016-2020, 厦门盈欣宝金融信息服务有限公司
 * Project Name :boot-parent
 * File Name: org.easytouseit.bootprop.config
 * Encoding UTF-8 
 * Version: 1.0 
 * Date: 2018-07-19 10:26
 * History:  
 * 1. Date: 2018-07-19
 *    Author: guojm 
 *    Modification: 新建
 * 2. ...
 */
package org.easytouseit.bootprop.config;

import org.easytouseit.bootprop.model.Attention;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * @author guojm
 * @version V1.0
 * @date 2018-07-19
 */
@Component
@ConfigurationProperties(prefix = "data")
public class DataProperties {
    // 字面值，字符串，布尔，数值
    /**
     * 普通字符串
     */
    private String str;
    /**
     * 转义特殊字符串
     */
    private String escapeStr;
    /**
     * 输出特殊字符串
     */
    private String notEscapeStr;
    /**
     * 布尔类型
     */
    private Boolean flag;
    /**
     * 整数
     */
    private Integer num;
    /**
     * 小数
     */
    private Double dNum;

    /**
     * 数组，List和Set，两种写法： 第一种：-空格value，每个值占一行，需缩进对齐；第二种：[1,2,...n] 行内写法
     */
    private List<Object> list; // list可重复集合
    private Set<Object> set;  // set不可重复集合
    /**
     * 数组
     */
    private String[] arr;
    private List<Map<String,String>> listMap;
    /**
     * Map和实体类，两种写法：第一种：key空格value，每个值占一行，需缩进对齐；第二种：{key: value,....} 行内写法
     */
    private Map<String, Object> map; // Map K-V
    private List<Attention> attentions; // 复合结构，集合对象

    public String getStr() {
        return str;
    }

    public void setStr(String str) {
        this.str = str;
    }

    public String getEscapeStr() {
        return escapeStr;
    }

    public void setEscapeStr(String escapeStr) {
        this.escapeStr = escapeStr;
    }

    public String getNotEscapeStr() {
        return notEscapeStr;
    }

    public void setNotEscapeStr(String notEscapeStr) {
        this.notEscapeStr = notEscapeStr;
    }

    public Boolean getFlag() {
        return flag;
    }

    public void setFlag(Boolean flag) {
        this.flag = flag;
    }

    public Integer getNum() {
        return num;
    }

    public void setNum(Integer num) {
        this.num = num;
    }

    public Double getdNum() {
        return dNum;
    }

    public void setdNum(Double dNum) {
        this.dNum = dNum;
    }

    public List<Object> getList() {
        return list;
    }

    public void setList(List<Object> list) {
        this.list = list;
    }

    public Set<Object> getSet() {
        return set;
    }

    public void setSet(Set<Object> set) {
        this.set = set;
    }

    public Map<String, Object> getMap() {
        return map;
    }

    public void setMap(Map<String, Object> map) {
        this.map = map;
    }

    public List<Attention> getAttentions() {
        return attentions;
    }

    public void setAttentions(List<Attention> attentions) {
        this.attentions = attentions;
    }

    public List<Map<String, String>> getListMap() {
        return listMap;
    }

    public void setListMap(List<Map<String, String>> listMap) {
        this.listMap = listMap;
    }

    public String[] getArr() {
        return arr;
    }

    public void setArr(String[] arr) {
        this.arr = arr;
    }

    @Override
    public String toString() {
        return "DataProperties{" +
                "str='" + str + '\'' +
                ", escapeStr='" + escapeStr + '\'' +
                ", notEscapeStr='" + notEscapeStr + '\'' +
                ", flag=" + flag +
                ", num=" + num +
                ", dNum=" + dNum +
                ", list=" + list +
                ", set=" + set +
                ", arr=" + Arrays.toString(arr) +
                ", listMap=" + listMap +
                ", map=" + map +
                ", attentions=" + attentions +
                '}';
    }
}
